<%@ page contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="zh">
<head>
    <base href="http://${header.host}${pageContext.request.contextPath}/">
    <meta charset="UTF-8">
    <title>用户信息展示</title>
</head>
<body>
<h1 align="center">用户信息列表</h1>

<table align="center" border="1" bgcolor="#ffc0cb" cellspacing="0">
    <caption>用户信息表</caption>
    <tr>
        <th>id</th>
        <th>姓名</th>
        <th>密码</th>
        <th>性别</th>
        <th>爱好</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${userList}" var="user" varStatus="s">
        <tr>
            <td>${user.id}</td>
            <td>${user.name}</td>
            <td>${user.password}</td>
            <td>${user.sex}</td>
            <td>${user.hobby}</td>
            <td><a href="mod_user?id=${user.id}">修改</a> <a href="del?id=${user.id}">删除</a></td>
        </tr>
    </c:forEach>
</table>
<div style="text-align: center;">
    总共${count}名用户<br>
    总共${pageNum}页<br>
    ${page}/${pageNum}页<br>
    <c:if test="${page>1}">
        <a href="userlist?page=${page-1}">上一页</a>
    </c:if>
    <c:if test="${page<pageNum}">
        <a href="userlist?page=${page+1}">下一页</a>
    </c:if><br>
    <a href="add_user.do" align="center">添加新用户</a>
</div>

</body>
</html>
